import {
  createRouter,
  createWebHashHistory
} from 'vue-router'

import Home from '@/views/home/Home.vue'

const routes = [{
    path: '/',
    component: Home
  },
  {
    name: 'detail',
    path: '/detail/:id',
    component: () => import( /* webpackChunkName: "detail" */ '@/views/detail/Detail.vue')
  },
  {
    path: '/login',
    component: () => import( /* webpackChunkName: "login" */ '@/views/login/Login.vue')
  },
  {
    path: '/store',
    component: () => import( /* webpackChunkName: "store" */ '@/views/store/Store.vue')
  },
  {
    path: '/user',
    component: () => import( /* webpackChunkName: "user" */ '@/views/user/UserInfo.vue'),
    children: [{
      path: 'update',
      component: () => import( /* webpackChunkName: "user" */ '@/views/user/UserInfoUpdate.vue')
    }]
  }, 
  {
    name: 'section',
    path: '/section/:id',
    component: () => import( /* webpackChunkName: "section" */ '@/views/section/Section.vue')
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/'
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router